home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!the-fix.sos.on.ca
- From: <verneb@the-fix.sos.on.ca>
- Date: Sun,14 Jan 96 14:45:50 -0500
- Newsgroups: comp.lang.c
- Subject: Re: What wrong with this code ??????
- Message-ID: <tcpnntpd.16.1.14.14.45.50.2781597121.340151@the-fix.sos.on.ca>
- References: <4dagqd$g7q@nntp.pinc.com>
- Organization: the FIX - Kitchener, Ontario CANADA
- NNTP-Posting-Host: the-fix.sos.on.ca
- X-MajorTCP-Version: MajorTCP/IP [1.80-0]
-
- To: INT:MCOLYNUCK@PIM.BC.CA
-
- Int:mcolynuck@pim.bc.ca,
-
- I >jarnot@iddis.com (Kevin J. Jarnot) wrote:
- I >
- I >>>>>>> "PAOPENG" == PAOPENG THEERADECH <tp86@wumpus.cc.uow.edu.au> writes:
- I >
- I >> PAOPENG> #include <stdio.h>
- I >.NG> /* copy input to output */
- I >.NG> main()
- I >.NG> {
- I >.NG> int c;
- I >.NG>
- I >.NG> printf("\nPlease Enter the character: ");
- I >.NG> c =getchar();
- I >.NG> while (c != EOF)
- I >.NG> {
- I >.NG> putchar(); /* remove 'c' */
- I >.NG> /*c = getchar; this is not needed */
- I >>
- I >.NG> /*} not needed */
- return 0;/* need this to complete program */
- I >.NG> }
- I >
- I >.NG> Do anyone here know what wrong with this code?
- I >
- I >
- I >
- I >
- I >>I'm not sure if it was your problem, but you forgot the parens
- I >>afer getchar.
- I >
- I >
- I >>You should have an interesting value stored in c! BTW, this is
- I >>valid C code, although you'll get a warning about mixing pointers
- I >>and integers.
- I >
- I >
- I >
- I >>Kevin
- I >
- I >
- I >
- I >Might be compiler dependant but shouldn't a the 'char' be an 'unsigned
- I >iint' ?
- I >
- I >Michael
- I >
- I >
- I >
- I >
- I >
- I >
- I >>--
- I >>Kevin J. Jarnot - Senior Software Engineer | mailto:jarnot@iddis.com
- I >>IDD Information Services Waltham, MA |
- I >http://www-cs.canisius.edu/~jarnot
- I >
- I >
- I >
-
- Verne H. Bohlender
- Box 416, Chesley, Ontario.Ca. N0G 1L0
- verneb@The-Fix.sos.on.ca
- ___
- * UniQWK #2158*
-
-